import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import { setupRouterGuards } from './router/guards'
import elementPlusPlugin from './plugins/element-plus'

// 引入全局样式
import './styles/index.scss'
import '@element-plus/icons-vue'

const app = createApp(App)
const pinia = createPinia()

app.use(pinia) // 安装 Pinia
app.use(router) // 安装 Router
setupRouterGuards(router) // 在 Pinia 和 Router 都安装完毕后，再设置路由守卫
app.use(elementPlusPlugin)

app.mount('#app')
